package org.linlinjava.litemall.web.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.linlinjava.litemall.core.util.ResponseUtil;
import org.linlinjava.litemall.web.annotation.LogAnno;
import org.linlinjava.litemall.web.annotation.LoginShop;
import org.linlinjava.litemall.web.netty.WebSocketHandler;
import org.linlinjava.litemall.web.service.WebPosAdService;
import org.springframework.web.bind.annotation.*;

@Api(tags = "POS外屏广告API")
@RestController
@RequestMapping("/web/posad")
@RequiredArgsConstructor
public class WebPosAdController extends ResponseUtil {

    private final WebPosAdService webPosAdService;

    @ApiOperation("广告展示-「门店｜展示」")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "page",value = "页数"),
            @ApiImplicitParam(name = "limit",value = "页量")
    })
    @LogAnno
    @GetMapping(value = {"posAdSByShopId"})
    public Response posAdSByShopId(@LoginShop Integer shopId,
                                   @RequestParam(value = "page",defaultValue = "1")Integer page,
                                   @RequestParam(value = "limit",defaultValue = "20")Integer limit){
        return ResponseUtil.ok(webPosAdService.posAdSByShopId(shopId,page,limit));
    }

}
